﻿import axios from 'axios'

const bluej_base_url = 'http://netease.bluej.cn';
// const allen_base_url = 'http://106.52.91.32:3000';
const allen_base_url = 'http://music.jszero.cn';

function getSource(options, success, fail) {
	let { url, method = 'get', params = {} } = options;
	return new Promise((resolve, reject) => {
		axios(allen_base_url  + url, {
			method: method,
			params: params,
			// headers: { 'withCredentials': true },
		}).then(res => {
			resolve(res)
		})
		.catch(err => {
			console.warn("错误信息", err);
			reject(err)
		});
	})
} 

export default {
	getSource
}